<template>
  
  <div>
       
      <van-row>
           <van-col span="24"> <heardes/> </van-col>

          <van-col span="5">  <tree/> </van-col>

          <van-col span="12">
           <van-row>
              
              <van-uploader :after-read="upload"/>
                
            <van-button @click="exp"> 导出 </van-button>
           </van-row>
          </van-col>
      </van-row>

  </div>

</template>

<script>
import heardes from '../comm/heardes.vue'

import Tree from '../comm/tree.vue'
import axios from '../../http/axios'


export default {
  components: { heardes,Tree },

  methods:{

      upload(file){
          let fromdata = new FormData()
          fromdata.append('file',file.file)
        //   axios({url:'upload',method:'post',data:fromdata}).then(res=>{
             axios('/upload','post',fromdata).then(res=>{
                console.log(res);
        //       console.log(res);
                alert("导入成功")   
          })
      },

      exp(){
          axios('download','post').then(res=>{
              console.log(res);
          })
      }


  }

   
}
</script>

<style>

</style>